package com.digital.smartgrow.entity.businesscenter;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 资讯管理
 * </p>
 *
 * @author xiewb
 * @since 2022-04-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("news")
@ApiModel(value="News对象", description="资讯管理")
public class News implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @NotBlank(message = "标题不能为空")
    @ApiModelProperty(value = "标题")
    @TableField("title")
    private String title;

    @NotBlank(message = "资讯类别不能为空")
    @ApiModelProperty(value = "资讯类别")
    @TableField("category")
    private String category;

    @ApiModelProperty(value = "资讯内容")
    @TableField("content")
    private String content;

    @ApiModelProperty(value = "是否置顶，0：否，1：是")
    @TableField("ranking")
    private Integer ranking;

    @ApiModelProperty(value = "附件")
    @TableField("attchment")
    private String attchment;

    @ApiModelProperty(value = "状态，0：禁用，1：启用")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "0：未删除，1：已删除", hidden = true)
    @TableLogic
    @TableField("deleted")
    private Integer deleted;

    @ApiModelProperty(value = "修改人", hidden = true)
    @TableField("updateId")
    private Integer updateId;

    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("updateTime")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "创建人", hidden = true)
    @TableField("createId")
    private Integer createId;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("createTime")
    private LocalDateTime createTime;


}
